import Api from '../Api'
import {controller,post,get} from "../../../decorator/decorator";
import {LOGIN_URL,RESET_PASSWORD,GETACCOUNT,NUMBER,SIGN,LOTTERYLIST,LOTTERY,TASKREDPACKET,SIGN_URL,REGISTER_URL,BUYER_VALIDATE,PERSON_INFO,BANK_BIND,BUYER_WITHDRAW_LIST,BUYER_BALANCE,BUYER_ACOUNTBIND,BUYERTRADE_RECORDS, WITHDRAW_APPLY,
  BUYER_WITHDRAW_APPLY,PAY_MEMBERSHIPFEE, VIP_RECORD_LIST} from '../../../common/config/url'
@controller('/buyer')
class UserApi extends Api{
  constructor(){
    super(UserApi);
  }
  // abnormal(param,res){
  //   alert(res.message)
  // }
  before(){
    App.$store.dispatch('changeLoading',true)

  }
  @post(RESET_PASSWORD,true)
  async resetPassword(params){
    return await this.common(params)
  }
  @get(NUMBER,true)
  async getNumber(params){
    return await this.common(params)
  }
  @get(GETACCOUNT,true)
  async getAccount(params){
    return await this.common(params)
  }
  @get(SIGN,true)
  async getSign(params){
    return await this.common(params)
  }
  @get(LOTTERY,true)
  async getLottery(params){
    return await this.common(params)
  }
  @post(TASKREDPACKET,true)
  async taskRedpacket(params){
    return await this.common(params)
  }
  @post(LOTTERYLIST,true)
  async lotteryList(params){
    return await this.common(params)
  }
  @post(LOGIN_URL,true)
  async login(params){
    return await this.common(params)
  }
  @post(SIGN_URL,true)
  async sign(params){
    return await this.common(params)
  }
  @post(REGISTER_URL,true)
  async register(params){
    return await this.common(params)
  }
  @post(BUYER_VALIDATE)
  async buyerValidate(params){
    return await this.common(params)
  }
  @post(PERSON_INFO)
  async personInfo(params){
    return await this.common(params)
  }
  @post(BANK_BIND)
  async bankBind(params){
    return await this.common(params)
  }
  @get(BUYER_BALANCE)
  async balance(params){
    return await this.common(params)
  }

  @post(BUYER_ACOUNTBIND)
  async acountBind(params){
    return await this.common(params)
  }
  @get(BUYERTRADE_RECORDS)
  async tradeRecords(params){
    return await this.common(params)
  }
  @get(BUYER_WITHDRAW_LIST)
  async withdrawList(params){
    return await this.common(params)
  }
  @get(PAY_MEMBERSHIPFEE)
  async payMembershipfee(params){
    return await this.common(params)
  }

  async withdrawDetail(params){
    return await this.common(params)
  }
  @post(BUYER_WITHDRAW_APPLY)
  async buyerWithdrawApply(params){
    return await this.common(params)
  }
  @post(WITHDRAW_APPLY)
  async withdrawApply(params){
    return await this.common(params)
  }
  @get(VIP_RECORD_LIST)
  async getVipRecordList(params){
    return await this.common(params)
  }
}
export {UserApi}
export default new UserApi()
